tools: Use rand when random is unavailable
authorEdward E <develinthedetail@gmail.com>
Tue, 22 Aug 2017 21:31:56 +0000 (16:31 -0500)
committerØyvind Kolås <pippin@gimp.org>
Wed, 23 Aug 2017 22:38:53 +0000 (00:38 +0200)
borrowed from c1f075f22c70de54c2b04ca5df008a5e406d3ca9

tools/babl-benchmark.c
tools/babl-gen-test-pixels.c

index 3ed3539f144a7554df34f64d5af47c7d20577334..fa964f973c5d25f5d01daccad3ad83ffef0f04c0 100644 (file)
 #include <math.h>
 #include "babl-internal.h"
 
+#ifndef HAVE_SRANDOM
+#define srandom srand
+#define random  rand
+#endif
+
 int ITERATIONS = 2;
 #define  N_PIXELS (512*1024)  // a too small batch makes the test set live
                                // in l2 cache skewing results
index 59e3176d2b4468b6343d61856ea23491f8666620..12b80400342220e5a35e1dfafe1af9a21edb33fa 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 
+#ifndef HAVE_SRANDOM
+#define srandom srand
+#define random  rand
+#endif
+
 #define BABL_PATH_NUM_TEST_PIXELS       3072
 #define BABL_CONVERSION_NUM_TEST_PIXELS 128
 #define BABL_FROMAT_NUM_TEST_PIXELS     256